package com.huawei.classroom.student.h06;

public class GameBase extends Building{
	public GameBase(int xx, int yy) {
		x=xx;
		y=yy;
		health=500;
		force=0;
		range=0;
	}
	//static是因为main里用类直接调用方法
	public static GameBase createGameBase(int x,int y) {
		return new GameBase(x,y);
	}
	public Role building(EnumObjectType type,int x,int y) {
		if(type==EnumObjectType.barrack)
			return new Barrack(x,y);
		if(type==EnumObjectType.warFactory)
			return new WarFactory(x,y);
		else {
			System.out.println("Error, only barrack or warFactory");
			return null;
		}
	}
}
